home *** CD-ROM | disk | FTP | other *** search
/ LOGIC Apps / Logic-APPLE_II_APPS.iso / mac / LOGIC Apple II 5.25" Library - ProDOS / PRO017.dsk / CMD.DOCUMENT.txt < prev    next >
Text File  |  2012-02-16  |  11KB  |  244 lines

  1.  
  2.  
  3.  
  4.        
  5.                       Instructions for Use of the Commands
  6.        
  7.             The programs on this disk which have the extension .CMD are
  8.        binary programs which install extensions to the ProDOS Basic
  9.        Interpreter.  To install a command, just BRUN it or use the "-"
  10.        command.  The routine which is used to get a buffer for the
  11.        command code requires that no strings be active at the time the
  12.        command is installed.  So, if you install the commands from a
  13.        STARTUP file, use PRINT CHR$(4) not PRINT D$.  You may also have
  14.        to use CLEAR to remove strings just before the command which BRUNs
  15.        the installation program.  If strings are active, the installation
  16.        program will stop and print an error message.  If the installation
  17.        program is run while a large Applesoft program is in memory and
  18.        part of the program is overwritten, the program is cleared from
  19.        memory.  The installation programs run at $2000, so any reasonable
  20.        STARTUP program will not be affected.
  21.        
  22.              With each of the commands, if you want to know if the
  23.        command has been installed already, you can simply issue the
  24.        command word alone from the keyboard or from within a program and
  25.        if the command is installed there will be no error.  If the
  26.        command has not been installed, BASIC will return a syntax error. 
  27.        If you issue a command from within a program, you must use PRINT
  28.        CHR$(4) since these are extensions to the commands supplied by
  29.        BASIC.SYSTEM and are equivalent to DOS commands.  All of the
  30.        commands can be invoked with upper case or lower case.
  31.        
  32.             The TYPE command is a slightly modified version of the TYPE
  33.        command by Tom Weishaar and Mark Simonsen printed in the June 84
  34.        issue of Softalk.  Syntax is:
  35.        
  36.        TYPE pathname[,@block.number]              TYPE TEXTFILE,@3
  37.        
  38.        The example would print the file TEXTFILE to the screen beginning
  39.        with the fourth block.  The @ parm, as with all syntax
  40.        descriptions in these notes which are enclosed in brackets, is
  41.        optional.  Any file type can be typed to the screen.  This can be
  42.        instructive if used on Applesoft files with GPLE's ESC-H or
  43.        control show function active.  For laughs, try typing a directory
  44.        file with the ESC-H function on.  If you issue a PR#1, you can
  45.        type files to your printer as well.
  46.        
  47.             The MORE command works like the TYPE command except that it
  48.        will print twelve lines and then wait for a keypress.  The MORE
  49.        command takes the L parameter to set the screen width in columns;
  50.        once set, the screen width will stay the same until you change it
  51.        or reinstall the command.  The default screen width is 80 columns.
  52.        
  53.             The COPY command copies ProDOS files.  The files may have the
  54.        same or a different name but must have different full path names. 
  55.        The dates of the files will not be modified when copied; as you
  56.        may have observed, the FILER changes the dates of files when it
  57.        copies them.  The one shortcoming of this COPY command is that it
  58.        will expand Sparse files. If you don't know what a Sparse file is,
  59.        you probably don't have any.  The command is much smaller, and
  60.        easier to write, because it doesn't concern itself with Sparse
  61.        files.  The syntax is:
  62.        
  63.        COPY /source.path,/destination.path
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.        
  71.        The command may be used with full pathnames or, if the prefix has
  72.        been set, you may omit the prefix.  The slot and drive parms are
  73.        ignored.
  74.        
  75.             The Applesoft program called MENU.COPY will install the COPY
  76.        command if necessary and then read in a directory and allow you to
  77.        mark the files to copy from one directory to another and then ask
  78.        for a destination directory.  This program facilitates batch
  79.        copying of files.  At this date, several similar but better
  80.        programs are available commercially, including COPY II+ version
  81.        6.X and the programs supplied by Glen Bredon with Procmd and
  82.        ProSel.
  83.        
  84.              A companion program called EXEC.MAKER works like MENU.COPY
  85.        to make up EXEC files to drive the COPY command for file copying
  86.        operations which you perform frequently. 
  87.        
  88.             The program COPY.CMDS installs three commands, a version of
  89.        the COPY command and two others, ADD and PART.  ADD is used to
  90.        concatenate two files.  The syntax is:
  91.        
  92.        ADD file1,file2
  93.        
  94.        where file1 will be added to the end of file2 producing a new,
  95.        longer file still bearing the same name as file2.  The companion
  96.        command, PART, can be used to create a file which is a segment of
  97.        a larger file.  The syntax is:
  98.        
  99.        PART bigfile,segment,A(block#),L(# of blocks)
  100.        
  101.        where the file segment is created. The segment begins at the block
  102.        number of the source file given with the A parameter.  The file
  103.        segment is the number of blocks long given in the L parameter.  If
  104.        you want to start with the beginning of BIGFILE and copy the first
  105.        270 blocks to a DISKII, you might give the command PART
  106.        /HARD1/BIGFILE,/FLOPPY/SEG1,A0,L270.  If BIGFILE is less than 270
  107.        blocks long, you would not be given an error message.  However, if
  108.        you want to check to see if all of a segment is copied, you can
  109.        check the BASIC.SYSTEM parameter VLNTH at $BE5F-BE60, which is
  110.        used by PART as a counter.  If VLNTH and VLNTH+1 = 0 then the end
  111.        of the source file was reached just when the number of blocks
  112.        requested had been copied, or the end of the source file was
  113.        reached before the number requested had been copied.  From BASIC
  114.        you might use this line:
  115.        
  116.        100  IF PEEK (48735) + PEEK (48736) = 0 THEN PRINT
  117.        "All of the blocks requested were copied."
  118.        
  119.        Put another way, if you write a loop to back up a large file,
  120.        check VLNTH to see if there is more of the file to copy.  If VLNTH
  121.        <> 0 then there are more blocks to copy;  if VLNTH = 0 then the
  122.        last PART command copied to the end of the file and the backup
  123.        procedure is complete.
  124.        
  125.             The FORMAT command does not format a disk.  It is used to
  126.        format text files which have carriage returns only to separate
  127.        paragraphs into lines of any length specified.  The syntax is:
  128.        
  129.        FORMAT textfile[,L66]
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.        
  137.        The default line length is 80 characters.
  138.        
  139.             The companion command, UNFORMAT, does the opposite.  The
  140.        syntax is:
  141.        
  142.        UNFORMAT textfile[,L35]
  143.        
  144.        This command converts the carriage returns at the end of lines
  145.        into a space but will do so only if the carriage return occurs
  146.        after the column number passed in the L parameter.  The default
  147.        column is column 65.  This parameter can be used to preserve
  148.        tabular data and short lines which aren't separated by a blank
  149.        line.  This command is useful for converting files read from
  150.        bulletin boards for editing in a word processor.  Have some
  151.        patience with this command as it processes one character at a
  152.        time; when input and output are both on a ramdisk, it works at
  153.        about one block per second.
  154.        
  155.             The defaults for FORMAT and UNFORMAT can be changed by
  156.        changing the value at $2003 in their installation programs.
  157.        
  158.             The command FILTER copies a text file but either deletes
  159.        every instance of a character or converts it to another.  The
  160.        syntax is:
  161.        
  162.        FILTER sourcefile,dest.file,A11[,B13]
  163.        
  164.        This example will convert all character 11's to character 13's. 
  165.        It would convert line feeds to carriage returns.  The value which
  166.        represents the character is the ASCII value of the character.  If
  167.        the B parm is omitted, the character specified with the A parm
  168.        will be deleted.  The source file is not affected.
  169.        
  170.             The MOUNT command is used to make a quick backup of a
  171.        ramdisk.  It will work only if the backup medium is equal or
  172.        larger in size than the ramdisk.  For safety, the target volume is
  173.        limited to $4FF (1279) blocks.  This would prevent backing up to a
  174.        large volume on a Sider, but will allow backing up to a 3.5" disk
  175.        or from a 1 Meg ramdisk to a 1 Meg volume on a Sider.  I wrote
  176.        this command for use with a 128K ramdisk and a Disk II.  Glen
  177.        Bredon's Prosel package contains a backup utility which will allow
  178.        backing up a large ramdisk or a hard disk on multiple floppies.
  179.        
  180.             This command may not work with all ramdisks.  The way it
  181.        works is to copy all blocks from the volume directory to the end
  182.        of the volume, skipping blocks marked as not used.  Most ramdisks
  183.        have some blocks which are either not implemented in the memory
  184.        map or are used for code storage.  If the ramdisk copies a block
  185.        of zeroes like the IIe /RAM volume does, or returns an I/O error
  186.        when such a block is reached, then the MOUNT command should work.
  187.        
  188.             To backup a ramdisk, start with a formatted ProDOS disk with
  189.        a suitable name.  The volume name must match the name you specify
  190.        when you use the command.  This is partly for safety since any
  191.        data on the disk will be overwritten when the backup is made.  The
  192.        syntax is:
  193.        
  194.        MOUNT /RAM,/RAM.BAK
  195.        
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.        The backup disk will take on the storage size of the ramdisk and
  203.        may be used as a regular disk.  That is, you can boot from the
  204.        backup disk and files may be saved to and read from it.  The only
  205.        difference is that the disk will have the limited storage of the
  206.        ramdisk.  To restore the ramdisk just reverse the order of the
  207.        command file names.  Using the same names as above:
  208.        
  209.        MOUNT /RAM.BAK,/RAM
  210.        
  211.        DANGER !!! If you want to use this command with the /RAM volume
  212.        automatically installed by ProDOS when you boot on an expanded IIe
  213.        or on a //c you must repair a bug in ProDOS.  First unlock a copy
  214.        of ProDOS version 1.1.1.  Then type the following:
  215.        
  216.        BLOAD PRODOS,A$2000,TSYS
  217.        CALL -151
  218.        *2B4F
  219.         0D
  220.        *2B4F:0F
  221.        *BSAVE PRODOS,A$2000,TSYS,L14848
  222.        <CTRL-C> <RET>
  223.        ]
  224.        
  225.        For ProDOS versions 1.0, 1.0.1, and 1.0.2 the change is *2B49:0F
  226.        and the length of PRODOS is 15360.
  227.        
  228.        BLOAD PRODOS,A$2000,TSYS
  229.        CALL -151
  230.        *2B49
  231.         0D
  232.        *2B49:0F
  233.        *BSAVE PRODOS,A$2000,TSYS,L15360
  234.        <CTRL-C> <RET>
  235.        ]
  236.        
  237.        If you fail to fix the bug, the machine will crash when you try to
  238.        restore the /RAM volume.  The bug is that when you try to write to
  239.        block #7 on the /RAM volume, the code fails to protect that block
  240.        and the arithmetic which maps the blocks maps block #7 to the zero
  241.        page and stack area.  When the write proceeds, the zero page
  242.        pointers are overwritten and the whole machine is scrambled.
  243.        
  244.